/**
 * The contents of this file are subject to the OpenMRS Public License
 * Version 1.0 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 * http://license.openmrs.org
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations
 * under the License.
 *
 * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
 */

package org.openmrs.module.clinicalsummary.evaluator.velocity;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.openmrs.module.clinicalsummary.evaluator.AbstractConfiguration;

public class VelocityConfiguration extends AbstractConfiguration {

	private static final Log log = LogFactory.getLog(VelocityConfiguration.class);

	private String template;

	private Map<String, Object> functions;

	/**
	 * Get the velocity template
	 *
	 * @return the velocity template
	 */
	public String getTemplate() {
		return template;
	}

	/**
	 * Set the velocity template
	 *
	 * @param template the velocity template
	 */
	public void setTemplate(final String template) {
		this.template = template;
	}

	/**
	 * Set the custom functions
	 *
	 * @return all the registered custom functions
	 */
	public Map<String, Object> getFunctions() {
		if (functions == null)
			functions = new HashMap<String, Object>();
		return functions;
	}

	/**
	 * Get all custom functions
	 *
	 * @param functions the map of all custom functions
	 */
	public void setFunctions(final Map<String, Object> functions) {
		this.functions = functions;
	}

	/**
	 * Add a new custom function to the map
	 *
	 * @param key      the key to refer to the function
	 * @param function the custom function object
	 */
	public void addFunctions(String key, Object function) {

	}

	/**
	 * Prepare the configuration and initialize the configuration property
	 */
	public void configure() {
	}
}
